﻿<UserControl x:Class="PokemonBattleOnline.PBO.Battle.NDS"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:ui="clr-namespace:PokemonBattleOnline.PBO.Elements"
             xmlns:b="clr-namespace:PokemonBattleOnline.PBO.Battle">
    <UserControl.Resources>
        <Style x:Key="BitmapGenderLabel" TargetType="Image">
            <Setter Property="Width" Value="9"/>
            <Setter Property="Height" Value="13"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding}" Value="Male">
                    <Setter Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Male.png"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding}" Value="Female">
                    <Setter Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Female.png"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Canvas Background="Black" Height="480" Width="400">
        <b:BattleField2D x:Name="board" IsHitTestVisible="False"/>
        <Canvas x:Name="rpms" Canvas.Right="14" Canvas.Top="9" IsHitTestVisible="False">
            <Canvas.Resources>
                <Style TargetType="ContentPresenter">
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Canvas Width="76" Height="19" UseLayoutRounding="True" SnapsToDevicePixels="True">
                                    <Canvas.Resources>
                                        <Style TargetType="TextBlock">
                                            <Setter Property="FontFamily" Value="SimSun"/>
                                        </Style>
                                    </Canvas.Resources>
                                    <Canvas.Background>
                                        <ImageBrush ImageSource="/PBO;component/images/UpperScreen/StateBar/Pokemon.png" />
                                    </Canvas.Background>
                                    <Label Content="{Binding Name}" Style="{x:Static ui:Controls.STextBlock}" FontSize="13" Canvas.Right="50" Canvas.Top="-6"/>
                                    <Label Content="{Binding Lv}" Style="{x:Static ui:Controls.STextBlock}" FontSize="12" FontWeight="Bold" Canvas.Left="49" Canvas.Top="-5"/>
                                    <Image DataContext="{Binding Gender}" Style="{StaticResource BitmapGenderLabel}" Canvas.Left="27" Canvas.Top="-6"/>
                                    <ContentControl Content="{Binding State}" ContentTemplate="{x:Static ui:Labels.PokemonState}" Canvas.Left="-45" Canvas.Top="7"/>
                                    <Image x:Name="mega" Height="15" Width="15" Canvas.Left="35" Canvas.Top="-7"/>
                                    <b:LifeBar DataContext="{Binding Hp}" Canvas.Left="21" Canvas.Top="10"/>
                                </Canvas>
                                <DataTemplate.Triggers>
                                    <DataTrigger Binding="{Binding Mega}" Value="Mega">
                                        <Setter TargetName="mega" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Mega.png"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Mega}" Value="Alpha">
                                        <Setter TargetName="mega" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Alpha.png"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Mega}" Value="Omega">
                                        <Setter TargetName="mega" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Omega.png"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding}" Value="{x:Null}">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                    </DataTrigger>
                                </DataTemplate.Triggers>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="Content" Value="{x:Null}">
                            <Setter Property="Visibility" Value="Hidden"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Canvas.Resources>
            <ContentPresenter Content="{Binding [0]}" Canvas.Right="0"/>
            <ContentPresenter Content="{Binding [1]}" Canvas.Right="150"/>
        </Canvas>
        <Canvas x:Name="opms" Canvas.Left="51" Canvas.Top="212" IsHitTestVisible="False">
            <Canvas.Resources>
                <Style TargetType="ContentPresenter">
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Canvas Width="76" Height="19" UseLayoutRounding="True" SnapsToDevicePixels="True">
                                    <Canvas.Resources>
                                        <Style TargetType="TextBlock">
                                            <Setter Property="FontFamily" Value="SimSun"/>
                                        </Style>
                                    </Canvas.Resources>
                                    <Canvas.Background>
                                        <ImageBrush ImageSource="/PBO;component/images/UpperScreen/StateBar/Pokemon.png" />
                                    </Canvas.Background>
                                    <Label Content="{Binding Name}" Style="{x:Static ui:Controls.STextBlock}" FontSize="13" Canvas.Right="50" Canvas.Top="-6"/>
                                    <Label Content="{Binding Lv}" Style="{x:Static ui:Controls.STextBlock}" FontSize="12" FontWeight="Bold" Canvas.Left="49" Canvas.Top="-5"/>
                                    <Image DataContext="{Binding Gender}" Style="{StaticResource BitmapGenderLabel}" Canvas.Left="27" Canvas.Top="-6"/>
                                    <ContentControl Content="{Binding State}" ContentTemplate="{x:Static ui:Labels.PokemonState}" Canvas.Left="-45" Canvas.Top="7"/>
                                    <Image x:Name="mega" Height="15" Width="15" Canvas.Left="35" Canvas.Top="-7"/>
                                    <b:LifeBarWithText DataContext="{Binding Hp}" Canvas.Left="21" Canvas.Top="10"/>
                                </Canvas>
                                <DataTemplate.Triggers>
                                    <DataTrigger Binding="{Binding Mega}" Value="Mega">
                                        <Setter TargetName="mega" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Mega.png"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Mega}" Value="Alpha">
                                        <Setter TargetName="mega" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Alpha.png"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Mega}" Value="Omega">
                                        <Setter TargetName="mega" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Omega.png"/>
                                    </DataTrigger>
                                </DataTemplate.Triggers>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="Content" Value="{x:Null}">
                            <Setter Property="Visibility" Value="Hidden"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Canvas.Resources>
            <ContentPresenter Content="{Binding [0]}" Canvas.Left="0"/>
            <ContentPresenter Content="{Binding [1]}" Canvas.Left="150"/>
        </Canvas>
        <b:Subtitle x:Name="subtitle" IsHitTestVisible="False" Canvas.Bottom="240"/>
        <b:ControlPanel x:Name="cp" Canvas.Left="40" Canvas.Top="240"/>
    </Canvas>
</UserControl>
